home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / xlog / xlog.h < prev   
Encoding:
C/C++ Source or Header  |  1993-07-25  |  1.9 KB  |  75 lines

  1. /*
  2.  * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7. #ifndef __XLOG_H
  8. #define __XLOG_H
  9.  
  10. /*
  11.  * $Id: xlog.h,v 2.2 1993/06/15 18:07:48 panos Exp $
  12.  */
  13.  
  14. /*
  15.  * Flags
  16.  */
  17. #define XLOG_NOFLAGS                    0x0
  18. #define XLOG_SET_LEVEL                0x1
  19. #define XLOG_NO_SIZECHECK            0x2
  20. #define XLOG_NO_ERRNO                0x4
  21. /* #define XLOG_PRINT_TIMESTAMP        0x8 */
  22. #define XLOG_PRINT_ID                0x10
  23. #define XLOG_PRINT_PID                0x20
  24.  
  25. /*
  26.  * Errors
  27.  */
  28. #define XLOG_ENOERROR                0
  29. #define XLOG_ESIZE                    1
  30. #define XLOG_EOPEN                    2
  31. #define XLOG_EFSTAT                    3
  32. #define XLOG_ENOMEM                    4
  33. #define XLOG_EBADOP                    5
  34.  
  35. /*
  36.  * Interface
  37.  */
  38.  
  39. #ifdef __ARGS
  40. #undef __ARGS
  41. #endif
  42.  
  43. #ifdef PROTOTYPES
  44. #  define __ARGS( s )               s
  45. #else
  46. #  define __ARGS( s )               ()
  47. #endif
  48.  
  49. typedef enum { XLOG_SYSLOG, XLOG_FILELOG } xlog_e ;
  50.  
  51. typedef enum
  52.     {
  53.         XLOG_LINK,                /* generic: link this log to another log             */
  54.         XLOG_CALLBACK,            /* generic: call this function in case of error */
  55.         XLOG_GETFLAG,            /* generic:    get value of specified flag            */
  56.         XLOG_SETFLAG,            /* generic:    set value of specified flag            */
  57.         XLOG_LEVEL,                /* syslog:  set the default syslog level            */
  58.         XLOG_FACILITY,            /* syslog:  set the default syslog facility        */
  59.         XLOG_PREEXEC,            /* syslog:    prepare the log for an exec(2)        */
  60.         XLOG_POSTEXEC,            /* syslog:    exec(2) failed                                */
  61.         XLOG_SIZECHECK,        /* filelog: check file size                             */
  62.         XLOG_GETFD,                /* filelog: get file descriptor of log file        */
  63.         XLOG_LIMITS             /* filelog: set (new) soft/hard limits                */
  64.     } xlog_cmd_e ;
  65.  
  66. typedef void *xlog_h ;
  67.  
  68. xlog_h xlog_create    __ARGS( ( xlog_e type, char *id, int flags, ... ) ) ;
  69. void xlog_destroy        __ARGS( ( xlog_h ) ) ;
  70. void xlog_write        __ARGS( ( xlog_h, char *buf, int len, int flags, ... ) ) ;
  71. int xlog_control        __ARGS( ( xlog_h, xlog_cmd_e, ... ) ) ;
  72. int xlog_parms            __ARGS( ( xlog_e type, ... ) ) ;
  73.  
  74. #endif    /* __XLOG_H */
  75.